#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define int long long
using pii=pair<int,int>;
#define gch getchar_unlocked
const int N=1e5+5;
int n,a[N],rem,now;
signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    rep(i,1,n) cin>>a[i];
    sort(a+1,a+n+1);
    rep(i,1,n){
        if(i>1){
            if(a[i]>a[i-1]) rem+=now,now=0;
            if(rem) rem--;
        }
        now++;
    }
    cout<<rem+now<<endl;
} 